package com.sjq.common.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sjq.common.dao.DictTreeDao;
import com.sjq.common.entity.DictTree;
import com.sjq.common.exception.ServiceException;
import com.sjq.common.service.DictTreeService;

@Service("dictService")
public class DictTreeServiceImpl implements DictTreeService {
    
    Logger logger = Logger.getLogger(DictTreeServiceImpl.class);
    
    @Autowired
    private DictTreeDao dictTreeDao;
    
    @Override
    public List<Map<String, Object>> findAllDictTree(String category) {
        List<Map<String, Object>> dictList = dictTreeDao.getAllDictByCategory(category);
        return dictList;
    }
    
	@Override
	public DictTree findSingleDictTree(String category,String pid) throws ServiceException {
		DictTree dictTree = dictTreeDao.selectSingleDictTree(category,pid);
		return dictTree;
	}

	@Override
	public List<Map<String, Object>> findDwTree() {
		 List<Map<String, Object>> dictList = dictTreeDao.getDwTree();
		 return dictList;
	}

}
